Skip to content

fix(i18n): wrap original error in i18n#1198

Closed
Haroka-74 wants to merge 1 commit intofloatpane:masterfrom
Haroka-74:fix/issue-1050
Closed

fix(i18n): wrap original error in i18n#1198
Haroka-74 wants to merge 1 commit intofloatpane:masterfrom
Haroka-74:fix/issue-1050

Conversation

@Haroka-74
Copy link
Copy Markdown
Contributor

What?

Replaced the %v verb with %w in i18n/parser.go when returning errors from the parser.

Why?

The previous implementation only wrapped ErrParseFailed. By rendering the underlying err as a string (%v), the error chain was broken. This prevented callers from using errors.Is() or errors.As() to detect the original cause of the failure. Using double %w (supported in Go 1.20+) ensures both the sentinel error and the root cause remain accessible in the error tree.

Closes #1050

@Haroka-74 Haroka-74 requested a review from a team as a code owner April 29, 2026 17:41
@github-actions github-actions Bot added the bug Something isn't working label Apr 29, 2026
Copy link
Copy Markdown
Member

@floatpanebot floatpanebot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Haroka-74! Please fix the following issues with your PR:

  • Title: Is too long (47 characters). The PR title must be strictly under 40 characters.

@Haroka-74 Haroka-74 changed the title fix(i18n): wrap underlying error in i18n parser fix(i18n): wrap original error in i18n Apr 29, 2026
@floatpanebot floatpanebot dismissed their stale review April 29, 2026 17:43

Formatting issues have been resolved. Thank you!

@Haroka-74 Haroka-74 closed this Apr 30, 2026
@Haroka-74 Haroka-74 deleted the fix/issue-1050 branch April 30, 2026 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: fmt.Errorf chain '%w: %v' loses original cause in i18n parser

2 participants